package Day08;

public class Demo03 {
    public static void main(String[] args) {
        int[] arr={1,2,3};
        String s = arrtoString(arr);
        System.out.println(s);
    }
    public static String arrtoString(int[] arr){
        StringBuilder s = new StringBuilder();
        s.append("[");
        for (int i = 0; i <arr.length ; i++) {
            if(i==arr.length-1){
                s.append(arr[i]);
            }else {
                s.append(arr[i]).append(", ");
            }
        }
        s.append("]");
        String s1=s.toString();
        return s1;
    }
}
